﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LPY.LeHealth.Service;
using LPY.LeHealth.DTO;


namespace LPY.LeHealth.WebSite.Controllers
{
    public class combo2Controller : Controller
    {
        private combo2service Combo2service;
        private ComboService ComboService;
        // GET: combo2
        public ActionResult Index()
        {
            return View();
        }
        public combo2Controller()
        {
            Combo2service = new combo2service();
            ComboService = new ComboService();
        }
        /// <summary>
        /// 显示套餐信息
        /// </summary>
        /// <returns></returns>
        public  ActionResult xian()
        {
            int id = Convert.ToInt32(Session["id"]);
            List<combo2> list = Combo2service.getcombo2list1(id);
            return Json(list, JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// 根据城市id显示套餐信息
        /// </summary>
        /// <returns></returns>
      public ActionResult comarea(string sex)
        {
            int cityid =Convert.ToInt32(Session["cityid"]);
            List<combo2> list = Combo2service.getbycityid(1,sex);
            return Json(list, JsonRequestBehavior.AllowGet); 

        }
      /// <summary>
      /// 按热门套餐价格排序全部信息
      /// </summary>
      /// <returns></returns>
      public ActionResult price(int eid)
      {

          List<ComboDTO> list = ComboService.getprice(eid);
          return Json(list, JsonRequestBehavior.AllowGet);

      }
      /// <summary>
      /// 按热门套餐价格排序前N条信息
      /// </summary>
      /// <returns></returns>
      public ActionResult Nprice(int eid)
      {
          List<ComboDTO> list = ComboService.getNprice(eid);
          return Json(list, JsonRequestBehavior.AllowGet);

      }

      /// <summary>
      /// 按热门套餐销量排序全部信息
      /// </summary>
      /// <returns></returns>
      public ActionResult sal(int eid)
      {

          List<ComboDTO> list = ComboService.getsal(eid);
          return Json(list, JsonRequestBehavior.AllowGet);

      }
      /// <summary>
      /// 按热门套餐销量排序前N条
      /// </summary>
      /// <returns></returns>
      public ActionResult Nsal(int eid)
      {

          List<ComboDTO> list = ComboService.Ngetsal(eid);
          return Json(list, JsonRequestBehavior.AllowGet);

      }

        
            
      /// <summary>
      ///按热门套餐ID显示
      /// </summary>
      /// <returns></returns>
      public ActionResult GetId(int eid)
      {

          List<ComboDTO> list = ComboService.GetId(eid);
          return Json(list,JsonRequestBehavior.AllowGet);

      }
        
      /// <summary>
      ///按热门套餐ID家加载全部
      /// </summary>
      /// <returns></returns>
      public ActionResult GetIdALL(int eid)
      {

          List<ComboDTO> list = ComboService.GetIdAll(eid);
          return Json(list,JsonRequestBehavior.AllowGet);

      }
    }
}